FOSSBilling \ Exception
Invalid module name FOSSBilling\Exception thrown with message "Invalid module name" Stacktrace: #4 FOSSBilling\Exception in /var/www/library/Box/Mod.php:57 #3 Box_Mod:__construct in /var/www/di.php:186 #2 {closure} in /var/www/library/Box/AppClient.php:22 #1 Box_AppClient:init in /var/www/library/Box/App.php:122 #0 Box_App:run in /var/www/index.php:94
Stack frames (5)
4
FOSSBilling\Exception
/library/Box/Mod.php57
3
Box_Mod __construct
/di.php186
2
{closure}
/library/Box/AppClient.php22
1
Box_AppClient init
/library/Box/App.php122
0
Box_App run
/index.php94
/var/www/library/Box/Mod.php
        'servicedomain',
        'servicedownloadable',
        'servicehosting',
        'servicelicense',
        'staff',
        'stats',
        'support',
        'system',
        'theme',
        'orderbutton',
        'formbuilder',
    ];
 
    /**
     * @param string $mod
     */
    public function __construct($mod)
    {
        if (!preg_match('#[a-zA-Z]#', $mod)) {
            throw new FOSSBilling\Exception('Invalid module name');
        }
 
        $this->mod = strtolower($mod);
    }
 
    public function setDi(Pimple\Container $di): void
    {
        $this->di = $di;
    }
 
    public function hasManifest()
    {
        return file_exists(Path::normalize($this->_getModPath() . 'manifest.json'));
    }
 
    public function getManifest(): array
    {
        if (!$this->hasManifest()) {
            throw new FOSSBilling\Exception('Module :mod manifest file is missing', [':mod' => $this->mod], 5897);
        }
Arguments
  1. "Invalid module name"
    
/var/www/di.php
 *
 * @return Box_Url
 */
$di['url'] = function () use ($di) {
    $url = new Box_Url();
    $url->setDi($di);
    $url->setBaseUri(SYSTEM_URL);
 
    return $url;
};
 
/*
 * Returns a new Box_Mod object, created with the provided module name.
 *
 * @param string $name The name of the module to create the object with.
 *
 * @return \Box_Mod The new Box_Mod object that was just created.
 */
$di['mod'] = $di->protect(function ($name) use ($di) {
    $mod = new Box_Mod($name);
    $mod->setDi($di);
 
    return $mod;
});
 
/*
 *
 * @param string $mod the name of the module to get
 *
 * @return mixed the service of the associated module
 */
$di['mod_service'] = $di->protect(fn ($mod, $sub = '') => $di['mod']($mod)->getService($sub));
 
/*
 *
 * @param string $name the name of the module to get the configuration of
 *
 * @return mixed the configuration of the associated module
 */
$di['mod_config'] = $di->protect(fn ($name) => $di['mod']($name)->getConfig());
/var/www/library/Box/AppClient.php
/**
 * Copyright 2022-2024 FOSSBilling
 * Copyright 2011-2021 BoxBilling, Inc.
 * SPDX-License-Identifier: Apache-2.0.
 *
 * @copyright FOSSBilling (https://www.fossbilling.org)
 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
 */
 
use DebugBar\Bridge\NamespacedTwigProfileCollector;
use FOSSBilling\Environment;
use FOSSBilling\TwigExtensions\DebugBar;
use Twig\Extension\ProfilerExtension;
use Twig\Profiler\Profile;
 
class Box_AppClient extends Box_App
{
    protected function init(): void
    {
        $m = $this->di['mod']($this->mod);
        $m->registerClientRoutes($this);
 
        if ($this->mod == 'api') {
            define('API_MODE', true);
 
            // Prevent errors from being displayed in API mode as it can cause invalid JSON to be returned.
            ini_set('display_errors', '0');
            ini_set('display_startup_errors', '0');
        } else {
            $extensionService = $this->di['mod_service']('extension');
            if ($extensionService->isExtensionActive('mod', 'redirect')) {
                $m = $this->di['mod']('redirect');
                $m->registerClientRoutes($this);
            }
 
            // init index module manually
            $this->get('', 'get_index');
            $this->get('/', 'get_index');
 
            // init custom methods for undefined pages
/var/www/library/Box/App.php
    }
 
    public function put(string $url, string $methodName, ?array $conditions = [], string $class = null): void
    {
        $this->event('put', $url, $methodName, $conditions, $class);
    }
 
    public function delete(string $url, string $methodName, ?array $conditions = [], string $class = null): void
    {
        $this->event('delete', $url, $methodName, $conditions, $class);
    }
 
    public function run(): string
    {
        $this->debugBar['time']->startMeasure('registerModule', 'Registering module routes');
        $this->registerModule();
        $this->debugBar['time']->stopMeasure('registerModule');
 
        $this->debugBar['time']->startMeasure('init', 'Initializing the app');
        $this->init();
        $this->debugBar['time']->stopMeasure('init');
 
        $this->debugBar['time']->startMeasure('checkperm', 'Checking access to module');
        $this->checkPermission();
        $this->debugBar['time']->stopMeasure('checkperm');
 
        return $this->processRequest();
    }
 
    /**
     * @param string $path
     */
    public function redirect($path): never
    {
        $location = $this->di['url']->link($path);
        header("Location: $location");
        exit;
    }
 
    public function render($fileName, $variableArray = []): string
/var/www/index.php
 
// If HTTP error code has been passed, handle it.
if (!is_null($http_err_code)) {
    switch ($http_err_code) {
        case '404':
            $e = new FOSSBilling\Exception('Page :url not found', [':url' => $url], 404);
            echo $app->show404($e);
 
            break;
        default:
            $http_err_code = intval($http_err_code);
            http_response_code($http_err_code);
            $e = new FOSSBilling\Exception('HTTP Error :err_code occurred while attempting to load :url', [':err_code' => $http_err_code, ':url' => $url], $http_err_code);
            echo $app->render('error', ['exception' => $e]);
    }
    exit;
}
 
// If no HTTP error passed, run the app.
echo $app->run();
exit;
 

Environment & details:

Key Value
PHP Version
"8.2.30"
Error code
0
Instance ID
"f43c80ed-c27f-402b-965d-bed00c8eb1bb"
Key Value
_url
"/}"
empty
empty
empty
empty
Key Value
USER
"www-data"
HOME
"/var/www"
HTTP_HOST
"your.tube"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT
"*/*"
REDIRECT_STATUS
"200"
SERVER_NAME
"your.tube"
SERVER_PORT
"443"
SERVER_ADDR
"10.202.0.6"
REMOTE_PORT
"55541"
REMOTE_ADDR
"216.73.216.135"
SERVER_SOFTWARE
"nginx/1.27.4"
GATEWAY_INTERFACE
"CGI/1.1"
HTTPS
"on"
REQUEST_SCHEME
"https"
SERVER_PROTOCOL
"HTTP/1.1"
DOCUMENT_ROOT
"/var/www"
DOCUMENT_URI
"/index.php"
REQUEST_URI
"/%7D"
SCRIPT_NAME
"/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
"_url=/%7D"
SCRIPT_FILENAME
"/var/www/index.php"
PATH_INFO
""
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1773313530.5896
REQUEST_TIME
1773313530
empty
0. Whoops\Handler\PrettyPageHandler